// logs.js
// const util = require('../../utils/util.js')
import dayjs from 'dayjs'

Page({
  data: {
    logs: []
  },
  onLoad() {
    /**
     * wx.getStorageSync('logs') - 从本地存储中获取存储的 logs 数据
     */


    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return {
          // date: util.formatTime(new Date(log)),
          date: dayjs(log).format('YYYY-MM-DD HH:mm:ss'),
          timeStamp: log
        }
      })
    })
  }
})
